<template>
    <div id="templateDiv">
        <!--<Spin size="large" fix v-if="ExportLoading"></Spin>-->
        <Form :label-width="130" inline>
            <Form-item label="发放年月:">
                <DatePicker type="month" v-model="queryParam.time"
                            placeholder="请选择发放年月" style="width: 200px" format="yyyy-MM"  :editable="false"></DatePicker>
            </Form-item>

            <Form-item label="类型:">
                <Select v-model="queryParam.type" style="width:200px">
                    <Option value="Add">新增</Option>
                    <Option value="Exit">退出</Option>
                    <Option value="In">跨区迁入</Option>
                    <Option value="Out">跨区迁出</Option>
                    <Option value="Change">动态变更</Option>
                </Select>
            </Form-item>

            <Form-item label="属地区划:">
                <area-linkage :areaCode.sync="queryParam.ssca0043"/>
            </Form-item>

            <Form-item label="查询方式:">
                <Select v-model="queryParam.isMember" style="width: 200px" @on-change="searchQueryNew">
                    <Option value="Family">按户</Option>
                    <Option value="Member">按人</Option>
                </Select>
            </Form-item>

            <Form-item label="姓名:">
                <Input v-model="queryParam.azcp0003" placeholder="请输入户主或成员姓名" style="width:200px"/>
            </Form-item>
            <Form-item label="身份证号码:">
                <Input v-model="queryParam.azcp0001" placeholder="请输入户主或成员身份证号码" style="width:200px"/>
            </Form-item>

            <Row class="button_row">
                 <span style="float: left;">
                 <Button type="primary" @click="exportExcel">导出</Button>

                </span>
                <span style="float: right;">
                 <Button type="primary" @click="searchQueryNew">查询</Button>
                 <Button type="primary" class="button_item_left" @click="searchResetNew">重置</Button>
                     </span>
            </Row>
        </Form>
        <div class="table_div">
            <vxe-table border
                       resizable
                       row-id="id"
                       :row-key="true"
                       show-overflow="tooltip"
                       highlight-hover-row
                       align="center"
                       header-align="center"
                       ref="xTree"
                       :loading="Loading"
                       :data="tableData">
                <template v-if="queryParam.isMember=='Family'">
                    <vxe-table-column field="assistance_type_name" title="救助类型" align="center" width="200"
                                      fixed="left"/>
                    <vxe-table-column field="areaName" title="属地区划" align="center" width="220" fixed="left"/>
                    <vxe-table-column field="azcp0001" title="户主身份证号码" align="center" width="200" fixed="left"/>
                    <vxe-table-column field="azcp0003" title="户主姓名" align="center" width="150" fixed="left"/>
                    <vxe-table-column field="time" title="发放年月" align="center" width="100"/>
                    <vxe-table-column field="azdf0001" title="家庭编号" align="center" width="180"/>
                    <vxe-table-column field="ssca0014" title="低保证号" align="center" width="140"/>
                    <vxe-table-column field="ssca0011" title="银行账号" align="center" width="140"/>
                    <vxe-table-column field="ssca0049" title="家庭月总收入" align="center" width="200"/>
                    <vxe-table-column field="ssca0051" title="家庭人口数" align="center" width="100"/>
                    <vxe-table-column field="ssca0052" title="保障人口数" align="center" width="100"/>
                    <vxe-table-column field="azdf0008" title="家庭住址" align="center" width="200"/>
                    <vxe-table-column field="ssca0025" title="分类救助上浮总金额" align="center" width="160"/>
                    <vxe-table-column field="ssca0065" title="家庭高龄补贴总金额" align="center" width="160"/>
                    <vxe-table-column field="ssca0026" title="救助金额" align="center" width="140"/>
                    <vxe-table-column field="family_full_money" title="总金额" align="center" width="140"/>
                    <vxe-table-column field="ssca0006" title="批准时间" align="center" width="140" :formatter="renderTime"/>
                </template>
                <template v-else>
                    <vxe-table-column field="assistance_type_name" title="救助类型" align="center" width="200"
                                      fixed="left"/>
                    <vxe-table-column field="areaName" title="属地区划" align="center" width="220" fixed="left"/>
                    <vxe-table-column field="householder" title="户主姓名" align="center" width="100" fixed="left"/>
                    <vxe-table-column field="azcp0003" title="成员姓名" align="center" width="140" key="17"/>
                    <vxe-table-column field="azcp0001" title="成员证件号码" align="center" width="180" key="18"/>
                    <vxe-table-column field="age" title="年龄" align="center" width="100" key="19"/>
                    <vxe-table-column field="time" title="发放年月" align="center" width="100" key="20"/>
                    <vxe-table-column field="azdf0001" title="家庭编号" align="center" width="180" key="21"/>
                    <vxe-table-column field="ssca0014" title="低保证号" align="center" width="140" key="22"/>
                    <vxe-table-column field="azdf0008" title="家庭住址" align="center" width="200" key="23"/>
                    <vxe-table-column field="ssbi0004" title="分类救助上浮类别" align="center" width="140" key="24"/>
                    <vxe-table-column field="ssbi0005" title="分类救助上浮金额" align="center" width="140" key="25"/>
                    <vxe-table-column field="ssbi0008" title="高龄补贴金额" align="center" width="140" key="26"/>
                    <vxe-table-column field="azcp0548" title="救助金额" align="center" width="140" key="27"/>
                    <vxe-table-column field="full_money" title="总金额" align="center" width="140" key="28"/>
                    <vxe-table-column field="ssca0006" title="批准时间" align="center" width="140" :formatter="renderTime"
                                      key="29"/>
                    <vxe-table-column field="azcp0517" title="与申请人关系" align="center" width="140" key="30"/>
                    <vxe-table-column field="azcp0004" title="性别" align="center" width="140" key="31"/>
                    <vxe-table-column field="azcp0013" title="户籍类别" align="center" width="140" key="32"/>
                    <vxe-table-column field="azcp0007" title="民族" align="center" width="140" key="33"/>
                    <vxe-table-column field="azcp0008" title="文化程度" align="center" width="140" key="34"/>
                    <vxe-table-column field="azcp0009" title="健康状况" align="center" width="140" key="35"/>
                    <vxe-table-column field="azcp0505" title="残疾等级" align="center" width="140" key="36"/>
                    <vxe-table-column field="azcp0504" title="残疾类别" align="center" width="140" key="37"/>
                    <vxe-table-column field="azcp0502" title="劳动能力丧失情况" align="center" width="140" key="38"/>
                </template>
            </vxe-table>
            <Page :total="dataCount" :page-size="pageSize" show-total class="paging"
                  @on-change="handleTableChange" :current="pageNo"></Page>
        </div>
    </div>

</template>

<script>
    import {CommonMixin} from '@/views/common/js/CommonMixin'
    import {getAction, postAction} from '@/api/request'

    export default {
        mixins: [CommonMixin],
        name: "list",
        props: {
            ssca0002: {
                type: String,
                default: '100'
            },
            ssca0012: {
                type: String,
                default: '100'
            },

        },

        data() {
            return {
                queryParam: {
                    type: 'Add',
                    isMember: 'Family',
                    time: this.DateFormat(new Date(), 'YYYY-MM')
                },
                url: {
                    list: '/api/ac/subsistence/selectStatisticalServiceImpl/pageList',
                    exportExcel: "/api/ac/subsistence/selectStatisticalServiceImpl/exportExcel",
                },
                exportFileName: "统计数据导出",
                Loading: false
            }
        },
        methods: {

            searchQueryNew() {
                this.queryParam.ssca0012 = this.ssca0012;
                this.queryParam.ssca0002 = this.ssca0002;
                var time = this.queryParam.time;
                if (!time) {
                    this.$Message.error("请选择发放时间");
                    return false
                } else {
                    this.queryParam.time = this.DateFormat(time, 'YYYY-MM');
                }
                this.tableData = [];
                this.dataCount = 1;
                this.loadData(1);
            },

            searchResetNew() {
                this.queryParam = {};
                this.queryParam.type = 'Add';
                this.queryParam.isMember = 'Family';
                this.queryParam.time = this.DateFormat(new Date(), 'YYYY-MM');
                this.searchQueryNew();
            }
        },
        created() {
        }
    }
</script>

<style scoped>

</style>